home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / 3d_tools / irit40s.lha / Irit / misc_lib / miscatt2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-30  |  1.2 KB  |  40 lines

  1. /*****************************************************************************
  2. * Setting attributes for objects.                         *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.2, Mar. 1990   *
  5. *****************************************************************************/
  6.  
  7. #include <string.h>
  8. #include <stdio.h>
  9. #include <math.h>
  10. #include "irit_sm.h"
  11. #include "imalloc.h"
  12. #include "miscattr.h"
  13.  
  14. /*****************************************************************************
  15. *   Routine to release the data slot of an attribute.                 *
  16. * This routine also exists in attribut.c with object handling. it will be    *
  17. * pulled iff no object handling is used.                     *
  18. *****************************************************************************/
  19. void FreeAttributeData(IPAttributeStruct *Attr)
  20. {
  21.     switch (Attr -> Type) {
  22.     case IP_ATTR_INT:
  23.         break;
  24.     case IP_ATTR_REAL:
  25.         break;
  26.     case IP_ATTR_STR:
  27.         IritFree((VoidPtr) Attr -> U.Str);
  28.         break;
  29.     case IP_ATTR_PTR:
  30.         IritFree((VoidPtr) Attr -> U.Ptr);
  31.         break;
  32.     case IP_ATTR_OBJ:
  33.         IritFatalError("Should not free object in misc attributes.");
  34.         break;
  35.     default:
  36.         IritFatalError("Undefined attribute type");
  37.         break;
  38.     }
  39. }
  40.